<?php
class Detail extends CI_Controller {
    public function __construct(){
        parent::__construct();
    }

    public function index() {
    }

    public function show() {
        require_once './application/core/sql.php';
        $ary_data = array();
        $this->load->library('session');
        if (empty($this->session->userdata('action')) == false) {
            $ary_data['action'] = $this->session->userdata('action');
        }

        $ary_param = array(
            'file_name' => 'front_end/category.sql',
            'key'       => 'get_category',
            'param'     => array()
        );

        $res = Sql::exec($ary_param);
        $ary_data['list_category'] = $res;

        $poetic_id = $this->uri->segment(4);
        $ary_param = array(
            'file_name' => 'front_end/detail.sql',
            'key'       => 'get_content_poetic',
            'param'     => array($poetic_id)
        );

        $res = Sql::exec($ary_param);
        $ary_data['content'] = $res[0];

        $this->load->view("front_end/home", $ary_data);
    }
}
?>